<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
	<link href="themes/css/ui.common.css"
			rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.child.css"
			rel="stylesheet" type="text/css" />
		<link href="themes/css/ui.tips.css"
			rel="stylesheet" type="text/css" />
		<link
			href="style/jquery_ui/jquery-ui-1.8.custom.css"
			rel="stylesheet" type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href="themes/css/ui.c.blue.css"></link>
		<link rel="stylesheet"
			href="themes/default/pagination.css"
			type="text/css"></link>
		<script
			src="Scripts/jquery-1.4.1.min.js"
			type="text/javascript"></script>
		<script
			src="Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>

		<script src="Scripts/ui.tips.js"
			type="text/javascript"></script>
		<script src="Scripts/ui.default.js "
			type="text/javascript" charset="UTF-8"></script>
					<script src="Scripts/ui.admincp.js"
			type="text/javascript" charset="UTF-8"></script>
		<script src="js/ui.editableObject.js"
			type="text/javascript"></script>
		<script src="js/goodsOrderHandler.js"
			type="text/javascript"></script>
		<script
			src="js/bussiness.goodsReturn.js"
			type="text/javascript"></script>
		<STYLE type="text/css">
.editorArea {
	display: none;
}
</STYLE>
		<script type="text/javascript"
			src="Scripts/ui.dialogFormHelper.js"></script>
		<title>待审批流通单列表</title>
<SCRIPT type="text/javascript">
			$(function(){
				
				$("#dialog").dialog("destroy"); 
				$("#dialog-form").dialog({
				autoOpen: false,
				height: 150,
				width: 300,
				modal: true,
				 
				close: function() {
					//allFields.val('').removeClass('ui-state-error');
				}
				});
				
				$('#checkGoodsButton').click(function() {   
						$("#dialog-form").dialog({'title':"审批 物资"});
				     $('#dialog-form').dialog('open'); 
				});
	            registeTabToggle("#addGoodsCategoryButton", "#cancelAddGoodsCategoryButton");
	            //注册功能按钮事件..
	            registeRowFuncButton();
				    
			    });
			//单击编辑按钮的时候,进行编辑, 
				//该模块中,需要在弹出层中编辑,因此可以在这里对弹出层上的表单控件进行赋值,
				//之后调用 最后一行代码显示弹出层..
				//如果不需要在弹出层进行编辑,可以直接在编辑按钮的 href 里面执行action 跳转..etc..
				//
				
				// 参数 e 包含两个属性:
				//			data ---> 所单击行的数据(一个数组)
				//			entityId ---> 对应 对象的 ID
				function toEditHandler(e)
				{ 
				    var columns = e.data;
					
					$("#dialog-form").dialog({'title':"审批物资订单"});
					$("#orderId").val(e.entityId);
					$('#dialog-form').dialog('open'); 
					
					
				}
				function checkPass(){
				
			var orderId=$("#orderId").val();
			var comments=$("#comments").val();
			//alert(orderId+":"+comments);
			location="goodsOrder!check.action?orderId="+orderId+"&comments="+comments+"&submitState=1";
			}
			function checkFail(){
			var orderId=$("#orderId").val();
			var comments=$("#comments").val();
			location="goodsOrder!check.action?orderId="+orderId+"&comments="+comments+"&submitState=0";
			}
			</script>
	</head>

	<body>
	 <div class="PageChild_Title">
        <img src=" themes/images/default/icons/archives.png" class="PageChild_Tbtnpic" />
        <span class="PageChild_separate"></span><span class="PageChild_TbtnText">
            <h2> 
               审批物资申请</h2>
        </span><span class="PageChild_separate"></span>
        <div id="marker" class="red-tips">
        </div>
        <div class="clear">
        </div>
    </div>
		<div class="PageChild_List">
			<table width="100%" border="0" cellspacing="0"
				style="text-align: left">
				<tbody class="PageChild_List_head">
					<tr>
						<td width="16">
							<img src="themes/images/default/icons/pcde_314.png" width="16"
								height="16" />
						</td>
						<td>
							订单号
						</td>
						<td>
							申请时间
						</td>
						
						<td>
							订单状态
						</td>
						<td>
							审批
						</td>


					</tr>
				</tbody>
				<tbody class="PageChild_List_main" style="text-align: left">
					<s:if test="list != null && list.size != 0">
					<s:iterator value="list" var="item">
						<!-- 物资类型列表开始 -->
						<tr class='td_no_bord'>
							<td class="td_width25">
								<span title="24"><input id="Chk_Num" type="checkbox"
										name="ReptShow$ctl01$Chk_Num" /> </span>
							</td>
							<td>
								<span><s:property value="#item.orderId" /></span>
							</td>
							<td>
								<span> <s:property value="#item.createTime" /></span>
							</td>
							


							<td>
								待审批
							</td>


							<td>
								<a class="ui-link-edit-button" id="sender_${item.orderId}"
									href="javascript:void(0);" state="0" entityId="${item.orderId}">
									<img src="themes/icons/edit.png" title="进行审批" /> </a> &nbsp;
							</td>
						</tr>
					</s:iterator>
					</s:if><s:else>
						<tr><td colspan="5">无记录</td></tr>
					</s:else>
				</tbody>
			</table>
		</div>
		<!--分页导航开始-->
		<div id="divTopPageNavi" class="list_r_title_text3">

				<!--分页导航开始-->
				<s:if test="currpage<=1">
					<span class='list_r_title_text3a'> <img
							src="themes/images/default/page_up_gray.gif"></img>
					</span>

				</s:if>
				<s:else>
					<span class='list_r_title_text3a'> <a name="link_page_prev"
						id="link_page_prev" href="javascript:void(0);"
						currentPage="${currpage-1}"> <img
								src="themes/images/default/page_up.gif"></img>
					</a> </span>
				</s:else>
				<span class='list_r_title_text3b'> 第${currpage
					}页/共${totalpage }页 </span>
				<s:if test="currpage>=totalpage">
					<span class='list_r_title_text3a'> <img
							src="themes/images/default/page_down_gray.gif"></img>
					</span>
				</s:if>
				<s:else>
					<span class='list_r_title_text3a'> <a name="link_page_next"
						id="link_page_next" href="javascript:void(0);"
						currentPage="${currpage+1 }"> <img
								src="themes/images/default/page_down.gif"></img>
					</a> </span>
				</s:else><span id="goToPageTextArea"><input type="text" id="goPageNum"/> <input type="button" id="turnToPageButton" value="GO"/></span>
			</div>
		<!--分页导航结束-->
			<!-- 弹出层标签 -->
	<div id="dialog-form" style="display: none;" title="添加新物资">
		<div class="ui-mainTab">
			<div>
				<input type="text" id="orderId" class="hiddenObject"/>
				<table width="100%" class="tb tb2">
					<tbody>
						<tr>
							<td class="mtd">
								审批意见:
							</td>
							<td>
								<input type="text" name="comments" id="comments">
							</td>
							<td width="20">
							</td>
						</tr>
					</tbody>
					<tr>
						<td class="mtd">
							<input type="button" value="通过"  id="checkPassed" onclick="checkPass()" >
						</td>
						<td>
							<input type="button" value="不通过" onclick="checkFail()">
						</td>
						<td>
						</td>
					</tr>
				</table>
			</div>
		</div>
</div>



	</body>
</html>
